﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="DiscussReply.aspx.vb" Inherits="WSADProject.DiscussReply" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div>

         <asp:FormView ID="FormView1" runat="server" BorderStyle="Solid" BorderWidth ="1" BorderColor ="WhiteSmoke" DataSourceID="SqlDataSource2">
            <EditItemTemplate>
                DiscussionSubject:
                <asp:TextBox ID="DiscussionSubjectTextBox" runat="server" Text='<%# Bind("DiscussionSubject") %>' />
                <br />
                Username:
                <asp:TextBox ID="UsernameTextBox" runat="server" Text='<%# Bind("Username") %>' />
                <br />
                CreatedDate:
                <asp:TextBox ID="CreatedDateTextBox" runat="server" Text='<%# Bind("CreatedDate") %>' />
                <br />
                CreatedTime:
                <asp:TextBox ID="CreatedTimeTextBox" runat="server" Text='<%# Bind("CreatedTime") %>' />
                <br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </EditItemTemplate>
            <InsertItemTemplate>
                DiscussionSubject:
                <asp:TextBox ID="DiscussionSubjectTextBox" runat="server" Text='<%# Bind("DiscussionSubject") %>' />
                <br />
                Username:
                <asp:TextBox ID="UsernameTextBox" runat="server" Text='<%# Bind("Username") %>' />
                <br />
                CreatedDate:
                <asp:TextBox ID="CreatedDateTextBox" runat="server" Text='<%# Bind("CreatedDate") %>' />
                <br />
                CreatedTime:
                <asp:TextBox ID="CreatedTimeTextBox" runat="server" Text='<%# Bind("CreatedTime") %>' />
                <br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </InsertItemTemplate>
            <ItemTemplate>
                <h3>Topic: <asp:Label ID="DiscussionSubjectLabel" runat="server" Text='<%# Bind("DiscussionSubject") %>' />
                </h3>
                Created by: <asp:Label ID="UsernameLabel" runat="server" Text='<%# Eval("Username")%>' /> <asp:Label ID="CreatedDateLabel" runat="server" Text='<%# Eval("CreatedDate", "{0:d}")%>' />
             on <asp:Label ID="CreatedTimeLabel" runat="server" Text='<%# Eval("CreatedTime", "{0:T}")%>' />
                
            </ItemTemplate>
        </asp:FormView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:fishconn %>" ProviderName="<%$ ConnectionStrings:fishconn.ProviderName %>" SelectCommand="SELECT [DiscussionSubject], [Username], [CreatedDate], [CreatedTime] FROM [tblDiscussion] WHERE ([DiscussionID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="DiscussionID" QueryStringField="DiscusID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>

        

       

        

    </div>

    <div id ="createdisscussionthread">
                <asp:Button ID="btnDiscuss" runat="server" Text="Reply" />
        <asp:Button ID="Button4" runat="server" Text="Button" style="display:none"/>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button4" PopupControlID="pnlpopup"
CancelControlID="btnCancel" BackgroundCssClass="modalBackground">
</ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="pnlpopup" runat="server" BackColor="White" style="display:none">
    <asp:TextBox ID="txtMessage" runat="server" TextMode="MultiLine" Height="82px" Width="407px" ></asp:TextBox><br />
<asp:Button ID="btnAdd" CommandName="Update" runat="server" Text="Reply to Discussion"/>
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />
</asp:Panel>
                <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
                    <AlternatingItemTemplate>
                         <li style="">Created By:
                            <asp:Label ID="UsernameLabel" runat="server" Text='<%# Eval("Username") %>' />
                            <br />
                            Message:
                            <asp:Label ID="MessageLabel" runat="server" Text='<%# Eval("Message") %>' />
                            <br />
                            Date:
                            <asp:Label ID="MessDateLabel" runat="server" Text='<%# Eval("MessDate") %>' />
                            <br />
                            Time:
                            <asp:Label ID="MessTimeLabel" runat="server" Text='<%# Eval("MessTime") %>' />
                            <br />
                        </li>
                    </AlternatingItemTemplate>
                    <EditItemTemplate>
                        <li style="">Username:
                            <asp:TextBox ID="UsernameTextBox" runat="server" Text='<%# Bind("Username") %>' />
                            <br />
                            Message:
                            <asp:TextBox ID="MessageTextBox" runat="server" Text='<%# Bind("Message") %>' />
                            <br />
                            MessDate:
                            <asp:TextBox ID="MessDateTextBox" runat="server" Text='<%# Bind("MessDate") %>' />
                            <br />
                            MessTime:
                            <asp:TextBox ID="MessTimeTextBox" runat="server" Text='<%# Bind("MessTime") %>' />
                            <br />
                            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                        </li>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                       No respose for Discussion.
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        <li style="">Username:
                            <asp:TextBox ID="UsernameTextBox" runat="server" Text='<%# Bind("Username") %>' />
                            <br />Message:
                            <asp:TextBox ID="MessageTextBox" runat="server" Text='<%# Bind("Message") %>' />
                            <br />MessDate:
                            <asp:TextBox ID="MessDateTextBox" runat="server" Text='<%# Bind("MessDate") %>' />
                            <br />MessTime:
                            <asp:TextBox ID="MessTimeTextBox" runat="server" Text='<%# Bind("MessTime") %>' />
                            <br />
                            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                        </li>
                    </InsertItemTemplate>
                    <ItemSeparatorTemplate>
<br />
                    </ItemSeparatorTemplate>
                    <ItemTemplate>
                        <li style="">Created By:
                            <asp:Label ID="UsernameLabel" runat="server" Text='<%# Eval("Username") %>' />
                            <br />
                            Message:
                            <asp:Label ID="MessageLabel" runat="server" Text='<%# Eval("Message") %>' />
                            <br />
                            Date:
                            <asp:Label ID="MessDateLabel" runat="server" Text='<%# Eval("MessDate") %>' />
                            <br />
                            Time:
                            <asp:Label ID="MessTimeLabel" runat="server" Text='<%# Eval("MessTime") %>' />
                            <br />
                        </li>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <ul id="itemPlaceholderContainer" runat="server" style="">
                            <li runat="server" id="itemPlaceholder" />
                        </ul>
                        <div style="">
                        </div>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        <li style="">Username:
                            <asp:Label ID="UsernameLabel" runat="server" Text='<%# Eval("Username") %>' />
                            <br />
                            Message:
                            <asp:Label ID="MessageLabel" runat="server" Text='<%# Eval("Message") %>' />
                            <br />
                            MessDate:
                            <asp:Label ID="MessDateLabel" runat="server" Text='<%# Eval("MessDate") %>' />
                            <br />
                            MessTime:
                            <asp:Label ID="MessTimeLabel" runat="server" Text='<%# Eval("MessTime") %>' />
                            <br />
                        </li>
                    </SelectedItemTemplate>
                </asp:ListView>
              </div> 
    
    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:fishconn %>" ProviderName="<%$ ConnectionStrings:fishconn.ProviderName %>" SelectCommand="SELECT Username, Message, MessDate, MessTime FROM TblDiscusThread WHERE (DissusionID = ?) ORDER BY MessDate, MessTime">
        <SelectParameters>
            <asp:QueryStringParameter Name="DissusionID" QueryStringField="DiscusID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:HiddenField ID="hiddenUsername" runat="server" />
    <asp:HiddenField ID="hiddenDiscussID" runat="server" />
</asp:Content>
